package com.fengshang.wedding.domain.service.internal;

import java.util.Collection;

import com.fengshang.wedding.domain.model.internal.TopicEntity;
/**
 * 
 *@author gembin@gmail.com
 * 
 */
public interface ITopicPersistenceService {
	/**
	 * 
	 * @param topicId
	 * @return
	 */
	public TopicEntity findTopicById(int topicId);
	/**
	 * 
	 * @param topic
	 * @return
	 */
	public TopicEntity updateTopic(TopicEntity topic);
	/**
	 * 
	 * @param userId
	 * @param topic
	 * @throws EntityNotFoundException if user with userId is not found
	 */
	public void createTopic(int userId, TopicEntity topic)throws EntityNotFoundException ;
	/**
	 * 
	 * @param topicId
	 */
	public void removeTopic(int topicId);
	/**
	 * 
	 * @param userId
	 * @param pageSize
	 * @param currentPage
	 * @return
	 */
	public Collection<TopicEntity> findUserTopicsByPagination(int userId,
			int pageSize, int currentPage);
	/**
	 * 		
	 * @param query
	 * @param pageSize
	 * @param currentPage
	 * @return
	 */
	public Collection<TopicEntity> findTopicsByPagination(String query,
			int pageSize, int currentPage);

	/**
	 * @param pageSize
	 * @return pages
	 */
	public int getTotalPages(int pageSize);

	/**
	 * with default pageSize 20
	 * 
	 * @return pages
	 */
	public int getTotalPages();
}
